package com.sina.shop.controller;

import com.sina.shop.util.IpUtils;
import com.sina.shop.web.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2018-01-23-18:33
 */
@Controller
@RequestMapping("ip")
public class IpController extends BaseController {

    @RequestMapping("getIp")
    @ResponseBody
    public String getIp(HttpServletRequest request) {
        String ip = IpUtils.getIpByRequest(request);
        String address=IpUtils.getAddresses("ip="+ip,null);
        return address;
    }
}
